home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / dev / misc / RenderLib.lha / RenderLib / Include / render / renderhooks.i < prev   
Encoding:
Text File  |  1997-03-05  |  3.6 KB  |  135 lines

  1.     IFND RENDERHOOKS_I
  2. RENDERHOOKS_I    SET    1
  3. **
  4. **    $VER: renderhooks.i 18.2 (5.3.97)
  5. **
  6. **    render.library definitions for callback hooks
  7. **
  8. **    © 1996 TEK neosçientists
  9. **
  10.  
  11. ;------------------------------------------------------------------------
  12.  
  13.     IFND    EXEC_TYPES_I
  14.     include    "exec/types.i"
  15.     ENDC
  16.  
  17.     IFND    UTILITY_HOOKS_I
  18.     include    "utility/hooks.i"
  19.     ENDC
  20.  
  21. ;------------------------------------------------------------------------
  22. ;
  23. ;    Progress Hook Message
  24. ;
  25. ;    Whenever your progress hook is called, your function
  26. ;    receives a pointer to this structure in a1. Check the
  27. ;    message type and proceed accordingly.
  28. ;
  29. ;    Also, you get a pointer to the object of concern in a2.
  30. ;    Warning: This is intended for identification only. You
  31. ;    are NOT allowed to perform operations inside your hook
  32. ;    function that could modify this object. If you try to
  33. ;    do so, your code will run into a deadlock.
  34. ;
  35. ;    Your progress hook has to return TRUE or FALSE
  36. ;    for continuation respective abortion.
  37. ;
  38. ;------------------------------------------------------------------------
  39.  
  40.     STRUCTURE    RND_ProgressMessage,0
  41.         ULONG    RND_PMsg_type        ; type of message, see below
  42.         ULONG    RND_PMsg_count        ; number to be displayed...
  43.         ULONG    RND_PMsg_total        ; ...inside this range
  44.     LABEL        RND_PMsg_SIZEOF
  45.  
  46.  
  47. ;------------------------------------------------------------------------
  48. ;
  49. ;    Types of progress messages
  50. ;
  51. ;    Neither depend on a certain number of calls nor on
  52. ;    calls in a specific order. It's up to the library
  53. ;    to decide
  54. ;    - how often to call your progress hook
  55. ;    - in what order to submit different types of messages
  56. ;    - in what step rate to call your progress hook
  57. ;    - whether to call your progress hook at all
  58. ;
  59. ;------------------------------------------------------------------------
  60.  
  61.     ; number of lines added to a histogram.
  62.     ; a2 is a pointer to the histogram.
  63.  
  64. PMSGTYPE_LINES_ADDED        EQU    1
  65.  
  66.  
  67.     ; number of colors chosen during quantization.
  68.     ; a2 is a pointer to the histogram.
  69.  
  70. PMSGTYPE_COLORS_CHOSEN        EQU    2
  71.  
  72.  
  73.     ; number of histogram entries adapted to the palette.
  74.     ; a2 is a pointer to the histogram.
  75.  
  76. PMSGTYPE_COLORS_ADAPTED        EQU    3
  77.  
  78.  
  79.     ; number of lines rendered to a palette.
  80.     ; a2 is a pointer to the palette.
  81.  
  82. PMSGTYPE_LINES_RENDERED        EQU    4
  83.  
  84.  
  85.     ; number of lines converted.
  86.     ; a2 is NULL.
  87.  
  88. PMSGTYPE_LINES_CONVERTED    EQU    5
  89.  
  90.  
  91. ;------------------------------------------------------------------------
  92. ;
  93. ;    Line Hook Message
  94. ;
  95. ;    This hook is executed by functions such as Render() once
  96. ;    before and once after converting a line.
  97. ;
  98. ;    When your line hook is called, your function receives a
  99. ;    pointer to this structure in a1. Check the message type and
  100. ;    proceed accordingly. Also, you get a pointer to the object
  101. ;    of concern in a2. This is either the source or destination
  102. ;    buffer.
  103. ;
  104. ;    This allows you to draw, save, convert etc. while rendering,
  105. ;    and to save memory. Specify RND_DestWidth = 0 to render into
  106. ;    a single-line buffer, and RND_SourceWidth = 0 to fetch from a
  107. ;    single-line buffer.
  108. ;
  109. ;    Your line hook has to return TRUE or FALSE
  110. ;    for continuation respective abortion.
  111. ;
  112. ;------------------------------------------------------------------------
  113.  
  114.     STRUCTURE    RND_LineMessage,0
  115.         ULONG    RND_LMsg_type        ; type of message, see below
  116.         ULONG    RND_LMsg_row        ; the row number being processed
  117.     LABEL        RND_LMsg_SIZEOF        
  118.  
  119.  
  120.     ; just completed a line. a2 is a pointer to the rendered data.
  121.     ; You may read from this buffer.
  122.  
  123. LMSGTYPE_LINE_RENDERED        EQU    6
  124.  
  125.  
  126.     ; now converting a new line. a2 is a pointer to the source buffer
  127.     ; where the input is expected. You may write to this buffer.
  128.  
  129. LMSGTYPE_LINE_FETCH        EQU    7
  130.  
  131.  
  132. ;------------------------------------------------------------------------
  133.  
  134.     ENDC
  135.